<?php
declare(strict_types=1);

use Hyperf\HttpServer\Router\Router;

Router::addGroup('/admin/',function (){
    Router::get('login','App\Controller\Admin\AuthController@login');
    Router::post('login-post','App\Controller\Admin\AuthController@loginPost');
    Router::get('logout','App\Controller\Admin\AuthController@logout');
    Router::addGroup('v1/',function(){
        Router::post('login','App\Controller\Admin\V1\AuthController@login');
        Router::post('register','App\Controller\Admin\V1\AuthController@register');
        Router::post('refresh-token','App\Controller\Admin\V1\AuthController@refreshToken');
        Router::post('logOut','App\Controller\Admin\V1\AuthController@logOut',
            ['middleware'=>[\App\Middleware\AdminJwtAuthMiddleware::class]]);

        Router::post('update-pwd','App\Controller\Admin\V1\AuthController@updatePwd',
            ['middleware'=>[\App\Middleware\AdminJwtAuthMiddleware::class]]);
        Router::post('update-info','App\Controller\Admin\V1\AuthController@updateInfo',
            ['middleware'=>[\App\Middleware\AdminJwtAuthMiddleware::class]]);
        Router::post('admin/info','App\Controller\Admin\V1\AuthController@getInfo',
            ['middleware'=>[\App\Middleware\AdminJwtAuthMiddleware::class]]);
        Router::get('area/all','App\Controller\Admin\V1\AreaController@all');

        Router::addGroup('home/',function(){
            //分类处理
            Router::get('index','App\Controller\Admin\V1\HomeController@index');
        },['middleware'=>[
            App\Middleware\AdminJwtAuthMiddleware::class
        ]]);

        Router::addGroup('bi/',function(){
            Router::post('cdd/thread','App\Controller\Admin\V1\Bi\CddController@thread');
            Router::post('cdd/thread/reply','App\Controller\Admin\V1\Bi\CddController@threadReply');
            Router::post('cdd/suggest','App\Controller\Admin\V1\Bi\CddController@suggest');
            Router::post('cdd/wechat','App\Controller\Admin\V1\Bi\CddController@wechat');
            Router::post('cdd/waqc','App\Controller\Admin\V1\Bi\CddController@waqc');
        },[]);

        Router::addGroup('cms/',function(){
            //分类处理
            Router::get('category/select','App\Controller\Admin\V1\Cms\CategoryController@select');
            Router::get('category/list','App\Controller\Admin\V1\Cms\CategoryController@list');
            Router::post('category/store','App\Controller\Admin\V1\Cms\CategoryController@store');
            Router::get('category/detail','App\Controller\Admin\V1\Cms\CategoryController@detail');
            Router::post('category/delete','App\Controller\Admin\V1\Cms\CategoryController@delete');
            //内容处理
            Router::get('post/list','App\Controller\Admin\V1\Cms\PostsController@list');
            Router::get('post/articles','App\Controller\Admin\V1\Cms\PostsController@articles');
            Router::get('post/detail','App\Controller\Admin\V1\Cms\PostsController@detail');
            Router::get('post/page','App\Controller\Admin\V1\Cms\PostsController@page');
            Router::post('post/store','App\Controller\Admin\V1\Cms\PostsController@store');
            Router::post('post/delete','App\Controller\Admin\V1\Cms\PostsController@delete');
        },['middleware'=>[
            App\Middleware\AdminJwtAuthMiddleware::class
        ]]);


        Router::addGroup('poster/',function(){
            //分类处理
            Router::get('list','App\Controller\Admin\V1\PosterController@list');
            Router::post('store','App\Controller\Admin\V1\PosterController@store');
            Router::get('detail','App\Controller\Admin\V1\PosterController@detail');
            Router::post('delete','App\Controller\Admin\V1\PosterController@delete');
            //内容处理
            Router::get('datum/list','App\Controller\Admin\V1\PosterDatumController@list');
            Router::get('datum/detail','App\Controller\Admin\V1\PosterDatumController@detail');
            Router::post('datum/store','App\Controller\Admin\V1\PosterDatumController@store');
            Router::post('datum/delete','App\Controller\Admin\V1\PosterDatumController@delete');
            Router::post('datum/change-field','App\Controller\Admin\V1\PosterDatumController@changeField');
        },['middleware'=>[
            App\Middleware\AdminJwtAuthMiddleware::class
        ]]);

        Router::addGroup('ad/',function(){
            //分类处理
            Router::get('space/all','App\Controller\Admin\V1\Ad\SpaceController@all');
            Router::get('space/list','App\Controller\Admin\V1\Ad\SpaceController@list');
            Router::post('space/store','App\Controller\Admin\V1\Ad\SpaceController@store');
            Router::get('space/detail','App\Controller\Admin\V1\Ad\SpaceController@detail');
            Router::post('space/delete','App\Controller\Admin\V1\Ad\SpaceController@delete');
            //内容处理
            Router::get('datum/list','App\Controller\Admin\V1\Ad\DataController@list');
            Router::get('datum/detail','App\Controller\Admin\V1\Ad\DataController@detail');
            Router::post('datum/store','App\Controller\Admin\V1\Ad\DataController@store');
            Router::post('datum/delete','App\Controller\Admin\V1\Ad\DataController@delete');
            Router::post('datum/change-field','App\Controller\Admin\V1\Ad\DataController@changeField');
        },['middleware'=>[
            App\Middleware\AdminJwtAuthMiddleware::class
        ]]);

        /**
         * 点位路由
         */
        Router::addGroup('point-position/',function(){
            //分类处理
            Router::get('category/all','App\Controller\Admin\V1\PointPosition\CategoryController@all');
            Router::get('category/list','App\Controller\Admin\V1\PointPosition\CategoryController@list');
            Router::post('category/store','App\Controller\Admin\V1\PointPosition\CategoryController@store');
            Router::get('category/detail','App\Controller\Admin\V1\PointPosition\CategoryController@detail');
            Router::post('category/delete','App\Controller\Admin\V1\PointPosition\CategoryController@delete');

            //预留手机号处理
            Router::get('allow/list','App\Controller\Admin\V1\PointPosition\AllowController@list');
            Router::post('allow/store','App\Controller\Admin\V1\PointPosition\AllowController@store');
            Router::get('allow/detail','App\Controller\Admin\V1\PointPosition\AllowController@detail');
            Router::post('allow/delete','App\Controller\Admin\V1\PointPosition\AllowController@delete');

            //点位处理
            Router::get('position/all','App\Controller\Admin\V1\PointPosition\PositionController@all');
            Router::get('position/list','App\Controller\Admin\V1\PointPosition\PositionController@list');
            Router::get('position/list-assign','App\Controller\Admin\V1\PointPosition\PositionController@listAssign');
            Router::post('position/store','App\Controller\Admin\V1\PointPosition\PositionController@store');
            Router::get('position/detail','App\Controller\Admin\V1\PointPosition\PositionController@detail');
            Router::post('position/delete','App\Controller\Admin\V1\PointPosition\PositionController@delete');
            Router::get('position/assign-manager','App\Controller\Admin\V1\PointPosition\PositionController@assignManager');
            Router::post('position/assign-manager-store','App\Controller\Admin\V1\PointPosition\PositionController@assignManagerStore');
            Router::post('position/export','App\Controller\Admin\V1\PointPosition\PositionController@export');
            //问卷配置
            Router::get('paper/all','App\Controller\Admin\V1\PointPosition\PaperController@all');
            Router::post('paper/store','App\Controller\Admin\V1\PointPosition\PaperController@store');
            Router::post('paper/delete','App\Controller\Admin\V1\PointPosition\PaperController@delete');
            Router::get('paper/answers','App\Controller\Admin\V1\PointPosition\PaperController@answers');
            Router::get('paper/answer/consts','App\Controller\Admin\V1\PointPosition\PaperController@answerConsts');
            Router::get('paper/answer/detail','App\Controller\Admin\V1\PointPosition\PaperController@answerDetail');
            Router::post('paper/answer/reply','App\Controller\Admin\V1\PointPosition\PaperController@answerReply');
            Router::post('paper/answer/delete','App\Controller\Admin\V1\PointPosition\PaperController@answerDelete');
            Router::get('paper/sheet','App\Controller\Admin\V1\PointPosition\PaperController@sheet');
            Router::post('paper/sheet/assign','App\Controller\Admin\V1\PointPosition\PaperController@sheetAssign');
            Router::post('paper/sheet/reject','App\Controller\Admin\V1\PointPosition\PaperController@sheetReject');
            Router::post('paper/grade','App\Controller\Admin\V1\PointPosition\PaperController@grade');
            Router::post('paper/sheet/reply','App\Controller\Admin\V1\PointPosition\PaperController@sheetReply');
            Router::post('paper/sheet/score','App\Controller\Admin\V1\PointPosition\PaperController@sheetScore');
            Router::get('paper/answers/static','App\Controller\Admin\V1\PointPosition\PaperController@answersStatic');
            Router::post('paper/answers/static/export','App\Controller\Admin\V1\PointPosition\PaperController@answersStaticExport');

            //监督员
            Router::get('supervisor/list','App\Controller\Admin\V1\PointPosition\SupervisorController@list');
            Router::get('supervisor/apply/list','App\Controller\Admin\V1\PointPosition\SupervisorController@applyList');
            Router::get('supervisor/apply/consts','App\Controller\Admin\V1\PointPosition\SupervisorController@applyConsts');
            Router::post('supervisor/apply/change-status','App\Controller\Admin\V1\PointPosition\SupervisorController@applyChangeStatus');
            Router::get('supervisor/own-position','App\Controller\Admin\V1\PointPosition\SupervisorController@ownPosition');

            //监督员组别
            Router::get('supervisor/group/list','App\Controller\Admin\V1\PointPosition\SupervisorController@groupList');
            Router::post('supervisor/group/store','App\Controller\Admin\V1\PointPosition\SupervisorController@groupStore');
            Router::post('supervisor/group/delete','App\Controller\Admin\V1\PointPosition\SupervisorController@groupDelete');

            Router::addGroup('statics/',function(){
                Router::get('area','App\Controller\Admin\V1\PointPosition\StaticsController@area');
                Router::get('category','App\Controller\Admin\V1\PointPosition\StaticsController@category');
                Router::get('user','App\Controller\Admin\V1\PointPosition\StaticsController@user');
                Router::get('position','App\Controller\Admin\V1\PointPosition\StaticsController@position');
                Router::post('position/export','App\Controller\Admin\V1\PointPosition\StaticsController@positionExport');
                Router::get('community','App\Controller\Admin\V1\PointPosition\StaticsController@community');
                Router::get('category-area','App\Controller\Admin\V1\PointPosition\StaticsController@categoryArea');
                Router::get('category-position','App\Controller\Admin\V1\PointPosition\StaticsController@categoryPosition');
                Router::get('category-question','App\Controller\Admin\V1\PointPosition\StaticsController@categoryQuestion');
            });
        },['middleware'=>[
            App\Middleware\AdminJwtAuthMiddleware::class
        ]]);

        /**
         * common路由
         */
        Router::addGroup('common/',function(){
            //分类处理
            Router::post('area/all','App\Controller\Admin\V1\Common\AreaController@all');
            Router::post('area/list','App\Controller\Admin\V1\Common\AreaController@list');
            Router::post('area/detail','App\Controller\Admin\V1\Common\AreaController@detail');
            Router::post('area/select','App\Controller\Admin\V1\Common\AreaController@select');
            Router::post('area/all/data','App\Controller\Admin\V1\Common\AreaController@allData');
            Router::post('street/all','App\Controller\Admin\V1\Common\StreetController@all');
            Router::post('street/list','App\Controller\Admin\V1\Common\StreetController@list');
            Router::post('street/detail','App\Controller\Admin\V1\Common\StreetController@detail');
            Router::post('street/store','App\Controller\Admin\V1\Common\StreetController@store',['middleware'=>[
                \App\Middleware\AdminJwtAuthMiddleware::class
            ]]);
            Router::post('street/delete','App\Controller\Admin\V1\Common\StreetController@delete',['middleware'=>[
                \App\Middleware\AdminJwtAuthMiddleware::class
            ]]);
            Router::post('community/all','App\Controller\Admin\V1\Common\CommunityController@all');
            Router::post('community/list','App\Controller\Admin\V1\Common\CommunityController@list');
            Router::post('community/detail','App\Controller\Admin\V1\Common\CommunityController@detail');
            Router::post('community/store','App\Controller\Admin\V1\Common\CommunityController@store',['middleware'=>[
                \App\Middleware\AdminJwtAuthMiddleware::class
            ]]);
            Router::post('community/delete','App\Controller\Admin\V1\Common\CommunityController@delete',['middleware'=>[
                \App\Middleware\AdminJwtAuthMiddleware::class
            ]]);
        },['middleware'=>[
            //App\Middleware\AdminJwtAuthMiddleware::class
        ]]);

        Router::addGroup('media/',function(){
            Router::post('upload/image','App\Controller\Admin\V1\Media\UploadController@image');
            Router::post('upload/file','App\Controller\Admin\V1\Media\UploadController@file');

            Router::post('upload/file/types','App\Controller\Admin\V1\Media\UploadController@fileTypes');

            //相册路由
            Router::get('album/all','App\Controller\Admin\V1\Media\AlbumController@all');
            Router::get('album/pictures','App\Controller\Admin\V1\Media\AlbumController@pictures');
        },['middleware'=>[
            \App\Middleware\AdminJwtAuthMiddleware::class
        ]]);

        Router::addGroup('company/',function(){
            Router::addGroup('unit/',function(){
                Router::get('list','App\Controller\Admin\V1\Company\UnitsController@list');
                Router::get('select','App\Controller\Admin\V1\Company\UnitsController@select');
                Router::get('detail','App\Controller\Admin\V1\Company\UnitsController@detail');
                Router::get('mine','App\Controller\Admin\V1\Company\UnitsController@mine');
                Router::post('store','App\Controller\Admin\V1\Company\UnitsController@store');
                Router::post('delete','App\Controller\Admin\V1\Company\UnitsController@delete');
            });
        },['middleware'=>[
            App\Middleware\AdminJwtAuthMiddleware::class
        ]]);

        Router::addGroup('paper/',function(){
            Router::post('store','App\Controller\Admin\V1\Paper\PaperController@store');
            Router::get('list','App\Controller\Admin\V1\Paper\PaperController@list');
            Router::get('detail','App\Controller\Admin\V1\Paper\PaperController@detail');
            Router::post('delete','App\Controller\Admin\V1\Paper\PaperController@delete');
            Router::post('statics','App\Controller\Admin\V1\Paper\PaperController@statics');
            Router::post('delete-question','App\Controller\Admin\V1\Paper\PaperController@deleteQuestion');

            Router::addGroup('answer/',function(){
                Router::get('list','App\Controller\Admin\V1\Paper\AnswerController@list');
                Router::get('detail','App\Controller\Admin\V1\Paper\AnswerController@detail');
                Router::post('delete','App\Controller\Admin\V1\Paper\AnswerController@delete');
            });

            Router::addGroup('question/',function(){
                Router::get('types','App\Controller\Admin\V1\Paper\QuestionController@types');
                Router::post('store','App\Controller\Admin\V1\Paper\QuestionController@store');
                Router::get('list','App\Controller\Admin\V1\Paper\QuestionController@list');
                Router::get('detail','App\Controller\Admin\V1\Paper\QuestionController@detail');
                Router::post('delete','App\Controller\Admin\V1\Paper\QuestionController@delete');
            });

            Router::addGroup('statics/',function(){
                Router::post('answerright/district','App\Controller\Admin\V1\Paper\StaticsController@answerRightDistrict');
                Router::post('answerright/street','App\Controller\Admin\V1\Paper\StaticsController@answerRightStreet');
                Router::post('answerright/community','App\Controller\Admin\V1\Paper\StaticsController@answerRightCommunity');

                Router::post('questionright/district','App\Controller\Admin\V1\Paper\StaticsController@questionRightDistrict');
                Router::post('questionright/street','App\Controller\Admin\V1\Paper\StaticsController@questionRightStreet');
                Router::post('questionright/community','App\Controller\Admin\V1\Paper\StaticsController@questionRightCommunity');

                Router::post('degree/district','App\Controller\Admin\V1\Paper\StaticsController@degreeDistrict');
                Router::post('degree/street','App\Controller\Admin\V1\Paper\StaticsController@degreeStreet');
                Router::post('degree/community','App\Controller\Admin\V1\Paper\StaticsController@degreeCommunity');

                Router::post('question/input','App\Controller\Admin\V1\Paper\StaticsController@inputQuestion');
                Router::post('question/input/export','App\Controller\Admin\V1\Paper\StaticsController@inputQuestionExport');
            });

        },['middleware'=>[
            \App\Middleware\AdminJwtAuthMiddleware::class
        ]]);

        Router::addGroup('material/',function(){
            Router::post('store','App\Controller\Admin\V1\Material\MaterialController@store');
            Router::get('list','App\Controller\Admin\V1\Material\MaterialController@list');
            Router::get('detail','App\Controller\Admin\V1\Material\MaterialController@detail');
            Router::get('show','App\Controller\Admin\V1\Material\MaterialController@show');
            Router::post('delete','App\Controller\Admin\V1\Material\MaterialController@delete');
            Router::post('recall','App\Controller\Admin\V1\Material\MaterialController@recall');
            Router::post('assign','App\Controller\Admin\V1\Material\MaterialController@assign');
            Router::post('assign/detail','App\Controller\Admin\V1\Material\MaterialController@assignDetail');

            Router::addGroup('project/',function(){
                Router::get('types','App\Controller\Admin\V1\Material\ProjectController@types');
                Router::post('store','App\Controller\Admin\V1\Material\ProjectController@store');
                Router::get('list','App\Controller\Admin\V1\Material\ProjectController@list');
                Router::get('detail','App\Controller\Admin\V1\Material\ProjectController@detail');
                Router::post('delete','App\Controller\Admin\V1\Material\ProjectController@delete');
            });

            Router::addGroup('sheet/',function(){
                Router::get('types','App\Controller\Admin\V1\Material\SheetController@types');
                Router::post('store','App\Controller\Admin\V1\Material\SheetController@store');
                Router::get('list','App\Controller\Admin\V1\Material\SheetController@list');
                Router::get('detail','App\Controller\Admin\V1\Material\SheetController@detail');
                Router::post('delete','App\Controller\Admin\V1\Material\SheetController@delete');
            });

            Router::addGroup('report/',function(){
                Router::get('list','App\Controller\Admin\V1\Material\ReportController@list');
                Router::get('list/sheets','App\Controller\Admin\V1\Material\ReportController@sheetList');
                Router::get('detail','App\Controller\Admin\V1\Material\ReportController@detail');
                Router::post('submit','App\Controller\Admin\V1\Material\ReportController@submit');
                Router::post('submit/verify','App\Controller\Admin\V1\Material\ReportController@submitVerify');
                Router::get('verify/list','App\Controller\Admin\V1\Material\ReportController@verifyList');
                Router::get('verify/sheet/list','App\Controller\Admin\V1\Material\ReportController@verifySheetList');
                Router::get('score/list','App\Controller\Admin\V1\Material\ReportController@scoreList');
                Router::get('score/sheet/list','App\Controller\Admin\V1\Material\ReportController@scoreSheetList');
                Router::post('areas','App\Controller\Admin\V1\Material\ReportController@areas');//获取下属地区
            });

            Router::addGroup('flow/',function(){
                Router::post('detail','App\Controller\Admin\V1\Material\FlowController@detail');
                Router::post('verify','App\Controller\Admin\V1\Material\FlowController@verify');
                Router::post('score','App\Controller\Admin\V1\Material\FlowController@score');
            });

        },['middleware'=>[
            \App\Middleware\AdminJwtAuthMiddleware::class
        ]]);


        /**
         * 会员路由
         */
        Router::addGroup('user/',function(){

            Router::get('list','App\Controller\Admin\V1\User\UserController@list');
            Router::get('detail','App\Controller\Admin\V1\User\UserController@detail');
            Router::post('delete','App\Controller\Admin\V1\User\UserController@delete');
            //会员标签
            Router::get('tag/list','App\Controller\Admin\V1\User\TagController@list');
            Router::get('tag/detail','App\Controller\Admin\V1\User\TagController@detail');
            Router::post('tag/store','App\Controller\Admin\V1\User\TagController@store');
            Router::post('tag/delete','App\Controller\Admin\V1\User\TagController@delete');


        },['middleware'=>[
            \App\Middleware\AdminJwtAuthMiddleware::class
        ]]);
        /**
         * 系统路由
         */
        Router::addGroup('sys/',function(){
            Router::get('config/get','App\Controller\Admin\V1\Sys\ConfigController@get');
            Router::post('config/store','App\Controller\Admin\V1\Sys\ConfigController@store');
        },['middleware'=>[
            \App\Middleware\AdminJwtAuthMiddleware::class
        ]]);
        /**
         * 权限路由
         */
        Router::addGroup('rbac/',function(){
            Router::addGroup('manager/',function(){
                Router::get('all','App\Controller\Admin\V1\Rbac\ManagerController@all');
                Router::get('list','App\Controller\Admin\V1\Rbac\ManagerController@list');
                Router::get('get/menu','App\Controller\Admin\V1\Rbac\ManagerController@getMenu');
                Router::get('detail','App\Controller\Admin\V1\Rbac\ManagerController@detail');
                Router::post('store','App\Controller\Admin\V1\Rbac\ManagerController@store');
                Router::post('delete','App\Controller\Admin\V1\Rbac\ManagerController@delete');
                Router::post('change-field','App\Controller\Admin\V1\Rbac\ManagerController@changeField');
            });

            Router::addGroup('role/',function(){
                Router::get('all','App\Controller\Admin\V1\Rbac\RoleController@all');
                Router::get('list','App\Controller\Admin\V1\Rbac\RoleController@list');
                Router::get('parent','App\Controller\Admin\V1\Rbac\RoleController@parent');
                Router::get('detail','App\Controller\Admin\V1\Rbac\RoleController@detail');
                Router::get('permissions','App\Controller\Admin\V1\Rbac\RoleController@permissions');
                Router::post('store','App\Controller\Admin\V1\Rbac\RoleController@store');
                Router::post('delete','App\Controller\Admin\V1\Rbac\RoleController@delete');
                Router::post('change-field','App\Controller\Admin\V1\Rbac\RoleController@changeField');
                Router::post('config-permission-store','App\Controller\Admin\V1\Rbac\RoleController@configPermissionStore');
            });

            Router::addGroup('permission/',function(){
                Router::get('all','App\Controller\Admin\V1\Rbac\PermissionController@all');
                Router::get('list','App\Controller\Admin\V1\Rbac\PermissionController@list');
                Router::get('detail','App\Controller\Admin\V1\Rbac\PermissionController@detail');
                Router::post('store','App\Controller\Admin\V1\Rbac\PermissionController@store');
                Router::post('delete','App\Controller\Admin\V1\Rbac\PermissionController@delete');
                Router::post('change-field','App\Controller\Admin\V1\Rbac\PermissionController@changeField');
            });

            Router::addGroup('menu/',function(){
                Router::get('all','App\Controller\Admin\V1\Rbac\MenuController@all');
                Router::get('select','App\Controller\Admin\V1\Rbac\MenuController@select');
                Router::get('list','App\Controller\Admin\V1\Rbac\MenuController@list');
                Router::get('detail','App\Controller\Admin\V1\Rbac\MenuController@detail');
                Router::post('store','App\Controller\Admin\V1\Rbac\MenuController@store');
                Router::post('delete','App\Controller\Admin\V1\Rbac\MenuController@delete');
                Router::post('change-field','App\Controller\Admin\V1\Rbac\MenuController@changeField');
            });

            Router::addGroup('route/',function(){
                Router::get('consts','App\Controller\Admin\V1\Rbac\RouteController@consts');
                Router::get('all','App\Controller\Admin\V1\Rbac\RouteController@all');
                Router::get('list','App\Controller\Admin\V1\Rbac\RouteController@list');
                Router::get('detail','App\Controller\Admin\V1\Rbac\RouteController@detail');
                Router::post('store','App\Controller\Admin\V1\Rbac\RouteController@store');
                Router::post('delete','App\Controller\Admin\V1\Rbac\RouteController@delete');
                Router::post('change-field','App\Controller\Admin\V1\Rbac\RouteController@changeField');
            });

        },['middleware'=>[
            \App\Middleware\AdminJwtAuthMiddleware::class
        ]]);
    });
},['middleware' => []]);